

<!DOCTYPE html>
<html lang="zh-CN" data-default-color-scheme=auto>



<head>
  <meta charset="UTF-8">
  <link rel="apple-touch-icon" sizes="76x76" href="/blog/img/fluid.png">
  <link rel="icon" href="/blog/img/fluid.png">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=5.0, shrink-to-fit=no">
  <meta http-equiv="x-ua-compatible" content="ie=edge">
  
  <meta name="theme-color" content="#2f4154">
  <meta name="author" content="Vincent">
  <meta name="keywords" content="">
  
    <meta name="description" content="​		 1.问题​		最近公司项目在部署到甲方环境时，出现了一个sql查询的问题  这个错误大概的意思就是： 12345SELECT列表的表达式不在GROUP BY子句和中包含非聚合列&amp;#x27;。。”不依赖于GROUP BY子句中的列;这是与SQL模式&#x3D;only不兼容。    2.原因官方是这样解释的：​		MySQL 5.7.5及更高版本实现了函数依赖性的检测。如果启用了ONLY_FULL_G">
<meta property="og:type" content="article">
<meta property="og:title" content="MySQL中关于sqlmode问题">
<meta property="og:url" content="https://zqystudy.gitee.io/blog/2022/10/19/MySQL%E4%B8%AD%E5%85%B3%E4%BA%8Esqlmode%E9%97%AE%E9%A2%98/index.html">
<meta property="og:site_name" content="Vincent">
<meta property="og:description" content="​		 1.问题​		最近公司项目在部署到甲方环境时，出现了一个sql查询的问题  这个错误大概的意思就是： 12345SELECT列表的表达式不在GROUP BY子句和中包含非聚合列&amp;#x27;。。”不依赖于GROUP BY子句中的列;这是与SQL模式&#x3D;only不兼容。    2.原因官方是这样解释的：​		MySQL 5.7.5及更高版本实现了函数依赖性的检测。如果启用了ONLY_FULL_G">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="https://img0.baidu.com/it/u=2096067828,1292178619&fm=253&app=138&size=w931&n=0&f=GIF&fmt=auto?sec=1667494800&t=e633d02fde95252d3c747da81c89fb06">
<meta property="article:published_time" content="2022-10-19T08:03:03.000Z">
<meta property="article:modified_time" content="2022-11-03T06:43:08.598Z">
<meta property="article:author" content="Vincent">
<meta property="article:tag" content="MySQL">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:image" content="https://img0.baidu.com/it/u=2096067828,1292178619&fm=253&app=138&size=w931&n=0&f=GIF&fmt=auto?sec=1667494800&t=e633d02fde95252d3c747da81c89fb06">
  
  
    <meta name="referrer" content="no-referrer-when-downgrade">
  
  
  <title>MySQL中关于sqlmode问题 - Vincent</title>

  <link  rel="stylesheet" href="https://lib.baomitu.com/twitter-bootstrap/4.6.1/css/bootstrap.min.css" />



  <link  rel="stylesheet" href="https://lib.baomitu.com/github-markdown-css/4.0.0/github-markdown.min.css" />

  <link  rel="stylesheet" href="https://lib.baomitu.com/hint.css/2.7.0/hint.min.css" />

  <link  rel="stylesheet" href="https://lib.baomitu.com/fancybox/3.5.7/jquery.fancybox.min.css" />



<!-- 主题依赖的图标库，不要自行修改 -->
<!-- Do not modify the link that theme dependent icons -->

<link rel="stylesheet" href="//at.alicdn.com/t/font_1749284_hj8rtnfg7um.css">



<link rel="stylesheet" href="//at.alicdn.com/t/font_1736178_lbnruvf0jn.css">


<link  rel="stylesheet" href="/blog/css/main.css" />


  <link id="highlight-css" rel="stylesheet" href="/blog/css/highlight.css" />
  
    <link id="highlight-css-dark" rel="stylesheet" href="/blog/css/highlight-dark.css" />
  



  
<link rel="stylesheet" href="/blog/css/mac.css">
<link rel="stylesheet" href="/blog/css/custom.css">



  <script id="fluid-configs">
    var Fluid = window.Fluid || {};
    Fluid.ctx = Object.assign({}, Fluid.ctx)
    var CONFIG = {"hostname":"zqystudy.gitee.io","root":"/blog/","version":"1.9.2","typing":{"enable":true,"typeSpeed":70,"cursorChar":"_","loop":false,"scope":[]},"anchorjs":{"enable":true,"element":"h1,h2,h3,h4,h5,h6","placement":"left","visible":"hover","icon":""},"progressbar":{"enable":true,"height_px":3,"color":"#29d","options":{"showSpinner":true,"trickleSpeed":100}},"code_language":{"enable":true,"default":"TEXT"},"copy_btn":true,"image_caption":{"enable":true},"image_zoom":{"enable":true,"img_url_replace":["",""]},"toc":{"enable":true,"placement":"right","headingSelector":"h1,h2,h3,h4,h5,h6","collapseDepth":0},"lazyload":{"enable":true,"loading_img":"/img/loading.gif","onlypost":true,"offset_factor":2},"web_analytics":{"enable":true,"follow_dnt":true,"baidu":null,"google":null,"gtag":null,"tencent":{"sid":null,"cid":null},"woyaola":null,"cnzz":null,"leancloud":{"app_id":"zc2OPBTVjL4nIWcxAdu9fkZp-gzGzoHsz","app_key":"vpIXqlueEoj5yt2RfIa84WzG","server_url":"https://zc2opbtv.lc-cn-n1-shared.com","path":"window.location.pathname","ignore_local":false},"statistics":{"enable":true,"source":"leancloud","pv_format":"总访问量 {} 次","uv_format":"总访客数 {} 人"}},"search_path":"/blog/local-search.xml"};

    if (CONFIG.web_analytics.follow_dnt) {
      var dntVal = navigator.doNotTrack || window.doNotTrack || navigator.msDoNotTrack;
      Fluid.ctx.dnt = dntVal && (dntVal.startsWith('1') || dntVal.startsWith('yes') || dntVal.startsWith('on'));
    }
  </script>
  <script  src="/blog/js/utils.js" ></script>
  <script  src="/blog/js/color-schema.js" ></script>
  

  

  

  

  

  

  

  
    
  



  
<meta name="generator" content="Hexo 6.2.0"></head>


<body>
  

  <header>
    

<div class="header-inner" style="height: 70vh;">
  <nav id="navbar" class="navbar fixed-top  navbar-expand-lg navbar-dark scrolling-navbar">
  <div class="container">
    <a class="navbar-brand" href="/blog/">
      <strong>VincentのBlog</strong>
    </a>

    <button id="navbar-toggler-btn" class="navbar-toggler" type="button" data-toggle="collapse"
            data-target="#navbarSupportedContent"
            aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
      <div class="animated-icon"><span></span><span></span><span></span></div>
    </button>

    <!-- Collapsible content -->
    <div class="collapse navbar-collapse" id="navbarSupportedContent">
      <ul class="navbar-nav ml-auto text-center">
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/blog/">
                <i class="iconfont icon-home-fill"></i>
                首页
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/blog/archives/">
                <i class="iconfont icon-archive-fill"></i>
                归档
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/blog/categories/">
                <i class="iconfont icon-category-fill"></i>
                分类
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/blog/tags/">
                <i class="iconfont icon-tags-fill"></i>
                标签
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/blog/about/">
                <i class="iconfont icon-user-fill"></i>
                关于
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/blog/talking/">
                <i class="iconfont icon-kakao-talk-fill"></i>
                talking
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/blog/links/">
                <i class="iconfont icon-link-fill"></i>
                友链
              </a>
            </li>
          
        
        
          <li class="nav-item" id="search-btn">
            <a class="nav-link" target="_self" href="javascript:;" data-toggle="modal" data-target="#modalSearch" aria-label="Search">
              &nbsp;<i class="iconfont icon-search"></i>&nbsp;
            </a>
          </li>
          
        
        
          <li class="nav-item" id="color-toggle-btn">
            <a class="nav-link" target="_self" href="javascript:;" aria-label="Color Toggle">&nbsp;<i
                class="iconfont icon-dark" id="color-toggle-icon"></i>&nbsp;</a>
          </li>
        
      </ul>
    </div>
  </div>
</nav>

  

<div id="banner" class="banner" parallax=true
     style="background: url('/blog/img/banner.jpg') no-repeat center center; background-size: cover;">
  <div class="full-bg-img">
    <div class="mask flex-center" style="background-color: rgba(0, 0, 0, 0.3)">
      <div class="banner-text text-center fade-in-up">
        <div class="h2">
          
            <span id="subtitle" data-typed-text="MySQL中关于sqlmode问题"></span>
          
        </div>

        
          
  <div class="mt-3">
    
      <span class="post-meta mr-2">
        <i class="iconfont icon-author" aria-hidden="true"></i>
        Vincent
      </span>
    
    
      <span class="post-meta">
        <i class="iconfont icon-date-fill" aria-hidden="true"></i>
        <time datetime="2022-10-19 16:03" pubdate>
          2022年10月19日 下午
        </time>
      </span>
    
  </div>

  <div class="mt-1">
    
      <span class="post-meta mr-2">
        <i class="iconfont icon-chart"></i>
        
          2.1k 字
        
      </span>
    

    
      <span class="post-meta mr-2">
        <i class="iconfont icon-clock-fill"></i>
        
        
        
          18 分钟
        
      </span>
    

    
    
      
        <span id="leancloud-page-views-container" class="post-meta" style="display: none">
          <i class="iconfont icon-eye" aria-hidden="true"></i>
          <span id="leancloud-page-views"></span>次
        </span>
        
      
    
  </div>


        
      </div>

      
    </div>
  </div>
</div>

</div>

  </header>

  <main>
    
      

<div class="container-fluid nopadding-x">
  <div class="row nomargin-x">
    <div class="side-col d-none d-lg-block col-lg-2">
      
  <aside class="sidebar category-bar" style="margin-right: -1rem">
    





<div class="category-list">
  
  
    
    
    
    <div class="category row nomargin-x">
      <a class="category-item 
          list-group-item category-item-action col-10 col-md-11 col-xm-11" title="Bug"
        id="heading-c83640c604dd5e0eacbf3de0a1181101" role="tab" data-toggle="collapse" href="#collapse-c83640c604dd5e0eacbf3de0a1181101"
        aria-expanded="true"
      >
        Bug
        <span class="list-group-count">(1)</span>
        <i class="iconfont icon-arrowright"></i>
      </a>
      
      <div class="category-collapse collapse show" id="collapse-c83640c604dd5e0eacbf3de0a1181101"
           role="tabpanel" aria-labelledby="heading-c83640c604dd5e0eacbf3de0a1181101">
        
        
          
  <div class="category-post-list">
    
    
      
      
        <a href="/blog/2022/10/19/MySQL%E4%B8%AD%E5%85%B3%E4%BA%8Esqlmode%E9%97%AE%E9%A2%98/" title="MySQL中关于sqlmode问题"
           class="list-group-item list-group-item-action
           active">
          <span class="category-post">MySQL中关于sqlmode问题</span>
        </a>
      
    
  </div>

        
      </div>
    </div>
  
</div>


  </aside>


    </div>

    <div class="col-lg-8 nopadding-x-md">
      <div class="container nopadding-x-md" id="board-ctn">
        <div id="board">
          <article class="post-content mx-auto">
            <!-- SEO header -->
            <h1 style="display: none">MySQL中关于sqlmode问题</h1>
            
              <p class="note note-info">
                
                  
                    本文最后更新于：2022年11月3日 下午
                  
                
              </p>
            
            
              <div class="markdown-body">
                
                <p>​		</p>
<h2 id="1-问题"><a href="#1-问题" class="headerlink" title="1.问题"></a>1.问题</h2><p>​		最近公司项目在部署到甲方环境时，出现了一个sql查询的问题</p>
<p><img src="https://img-blog.csdnimg.cn/7a848cdd6e7b4977a7bf2328fec0da0c.png" srcset="/blog/img/loading.gif" lazyload></p>
<p>这个错误大概的意思就是：</p>
<figure class="highlight text"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><code class="hljs text">SELECT列表的表达式不在GROUP BY子句和中<br><br>包含非聚合列&#x27;。。”不依赖于GROUP BY子句中的列;<br><br>这是与SQL模式=only不兼容。<br></code></pre></td></tr></table></figure>



<h2 id="2-原因"><a href="#2-原因" class="headerlink" title="2.原因"></a>2.原因</h2><h4 id="官方是这样解释的："><a href="#官方是这样解释的：" class="headerlink" title="官方是这样解释的："></a><a target="_blank" rel="noopener" href="https://dev.mysql.com/doc/refman/5.7/en/group-by-handling.html">官方</a>是这样解释的：</h4><p>​		MySQL 5.7.5及更高版本实现了函数依赖性的检测。如果启用了ONLY_FULL_GROUP_BY SQL模式(默认情况下是这样)，MySQL将拒绝select列表、HAVING条件或ORDER by列表引用既不在GROUP by子句中命名也在功能上依赖于它们的非聚合列的查询。(在5.7.5版本之前，MySQL不检测函数依赖性，并且默认没有启用ONLY_FULL_GROUP_BY。有关5.7.5之前行为的描述<br>​		大概意思就是：因为数据库版本的问题，sql_mode&#x3D;only_full_group_by被限制了，导致以往MySQL版本中能正常查询的sql，不能用了，就是在使用group by的时候select 查询字段一定都要在group by后面的列中，如果select的某些列没在后面，就会报这个错</p>
<h2 id="3-解决方法"><a href="#3-解决方法" class="headerlink" title="3.解决方法"></a>3.解决方法</h2><h3 id="1-修改MySQL的配置"><a href="#1-修改MySQL的配置" class="headerlink" title="1.修改MySQL的配置"></a>1.修改MySQL的配置</h3><p>通过查询语句查看当前的sql_mode</p>
<figure class="highlight sql"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><code class="hljs sql"><span class="hljs-keyword">select</span> @<span class="hljs-variable">@GLOBAL</span> sql_mode;<br>或<br><span class="hljs-keyword">select</span> @<span class="hljs-variable">@SESSION</span> sql_mode;<br></code></pre></td></tr></table></figure>

<p>查询结果应该是</p>
<p class="note note-success" style="font-size=15px"> ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION
</p>

<p>然后重新设置sql_mode</p>
<p class="note note-success" style="font-size=15px">SET SESSION sql_mode= "STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION" </p>

<h5 id="将ONLY-FULL-GROUP-BY-去掉"><a href="#将ONLY-FULL-GROUP-BY-去掉" class="headerlink" title="将ONLY_FULL_GROUP_BY 去掉"></a>将ONLY_FULL_GROUP_BY 去掉</h5><h3 id="2-使用any-value"><a href="#2-使用any-value" class="headerlink" title="2.使用any_value"></a>2.使用any_value</h3><p>在查询的列当中使用any_value包裹，group by后的字段不需要使用any_value。</p>
<figure class="highlight sql"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs sql"><span class="hljs-keyword">SELECT</span> name, any_value(contact) <span class="hljs-keyword">as</span> contact <span class="hljs-keyword">FROM</span> customer <span class="hljs-keyword">GROUP</span> <span class="hljs-keyword">BY</span> `name`<br></code></pre></td></tr></table></figure>

<br>

<p class="note note-warning" style="font-size:20px">注意：group by后面的having语句中的字段也需要使用any_value包裹，排序字段亦是如此</p>



<h2 id="4-sql-mode"><a href="#4-sql-mode" class="headerlink" title="4.sql_mode"></a>4.sql_mode</h2><p>前面看了关于sql_mode问题，下面深入的了解一下sql_mode到底是什么。</p>
<h3 id="1-什么是sql-mode"><a href="#1-什么是sql-mode" class="headerlink" title="1.什么是sql_mode"></a>1.什么是sql_mode</h3><p>sql_mode是一组mysql语法校验规则,定义了mysql应该支持的sql语法、数据校验等</p>
<h3 id="2-sql-mode有什么作用"><a href="#2-sql-mode有什么作用" class="headerlink" title="2.sql_mode有什么作用"></a>2.sql_mode有什么作用</h3><p>sql_mode常用来解决下面几个问题</p>
<ol>
<li>通过设置sql_mode，可以完成不同严格程度的数据校验，有效的保障数据准备性。</li>
<li>通过设置sql_mode为宽松模式，来保证大多数sql符合标准的语法，这样应用在不同数据库之间进行迁移时，则不需要对业务sql进行较大的修改</li>
<li>在不同数据库之间进行数据迁移之前，通过设置sql_mode可以使mysql上的数据更方便的迁移到目标数据库中。</li>
</ol>
<h3 id="3-如何查看sql-mode配置"><a href="#3-如何查看sql-mode配置" class="headerlink" title="3.如何查看sql_mode配置"></a>3.如何查看sql_mode配置</h3><p>查询sqlmode前文已经介绍</p>
<figure class="highlight sql"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><code class="hljs sql"><span class="hljs-keyword">select</span> @<span class="hljs-variable">@GLOBAL</span> sql_mode;<br>或<br><span class="hljs-keyword">select</span> @<span class="hljs-variable">@SESSION</span> sql_mode;<br></code></pre></td></tr></table></figure>



<h3 id="4-sql-mode模式"><a href="#4-sql-mode模式" class="headerlink" title="4.sql_mode模式"></a>4.sql_mode模式</h3><table>
<thead>
<tr>
<th align="center">sql_mode值</th>
<th align="center">描述</th>
</tr>
</thead>
<tbody><tr>
<td align="center">ONLY_FULL_GROUP_BY</td>
<td align="center">对于GROUP BY聚合操作,如果在SELECT中的列,没有在GROUP BY中出现,那么这个SQL是不合法的,因为列不在GROUP BY从句中</td>
</tr>
<tr>
<td align="center">NO_AUTO_VALUE_ON_ZERO</td>
<td align="center">该值影响自增长列的插入。默认设置下,插入0或NULL代表生成下一个自增长值。如果用户 希望插入的值为0,而该列又是自增长的,那么这个选项就有用了。</td>
</tr>
<tr>
<td align="center">STRICT_TRANS_TABLES</td>
<td align="center">在该模式下,如果一个值不能插入到一个事务表中,则中断当前的操作,对非事务表不做限制</td>
</tr>
<tr>
<td align="center">NO_ZERO_IN_DATE</td>
<td align="center">在严格模式下,不允许日期和月份为零</td>
</tr>
<tr>
<td align="center">NO_ZERO_DATE</td>
<td align="center">设置该值,mysql数据库不允许插入零日期,插入零日期会抛出错误而不是警告。</td>
</tr>
<tr>
<td align="center">ERROR_FOR_DIVISION_BY_ZERO</td>
<td align="center">在INSERT或UPDATE过程中,如果数据被零除,则产生错误而非警告。如 果未给出该模式,那么数据被零除时MySQL返回NULL</td>
</tr>
<tr>
<td align="center">NO_AUTO_CREATE_USER</td>
<td align="center">禁止GRANT创建密码为空的用户</td>
</tr>
<tr>
<td align="center">NO_ENGINE_SUBSTITUTION</td>
<td align="center">如果需要的存储引擎被禁用或未编译,那么抛出错误。不设置此值时,用默认的存储引擎替代,并抛出一个异常</td>
</tr>
<tr>
<td align="center">PIPES_AS_CONCAT</td>
<td align="center">将“||”作为字符串的链接字符操作，而不是作为运算符，样本“concat”相类似</td>
</tr>
<tr>
<td align="center">ANSI_QUOTES</td>
<td align="center">启用ANSI_QUOTES后,不能用双引号来引用字符串,因为它被解释为识别符</td>
</tr>
</tbody></table>

                
              </div>
            
            <hr/>
            <div>
              <div class="post-metas my-3">
  
    <div class="post-meta mr-3 d-flex align-items-center">
      <i class="iconfont icon-category"></i>
      

<span class="category-chains">
  
  
    
      <span class="category-chain">
        
  <a href="/blog/categories/Bug/" class="category-chain-item">Bug</a>
  
  

      </span>
    
  
</span>

    </div>
  
  
    <div class="post-meta">
      <i class="iconfont icon-tags"></i>
      
        <a href="/blog/tags/MySQL/">#MySQL</a>
      
    </div>
  
</div>


              
  

  <div class="license-box my-3">
    <div class="license-title">
      <div>MySQL中关于sqlmode问题</div>
      <div>https://zqystudy.gitee.io/blog/2022/10/19/MySQL中关于sqlmode问题/</div>
    </div>
    <div class="license-meta">
      
        <div class="license-meta-item">
          <div>作者</div>
          <div>Vincent</div>
        </div>
      
      
        <div class="license-meta-item license-meta-date">
          <div>发布于</div>
          <div>2022年10月19日</div>
        </div>
      
      
        <div class="license-meta-item license-meta-date">
          <div>更新于</div>
          <div>2022年11月3日</div>
        </div>
      
      <div class="license-meta-item">
        <div>许可协议</div>
        <div>
          
            
            
              <a target="_blank" href="https://creativecommons.org/licenses/by/4.0/">
              <span class="hint--top hint--rounded" aria-label="BY - 署名">
                <i class="iconfont icon-by"></i>
              </span>
              </a>
            
          
        </div>
      </div>
    </div>
    <div class="license-icon iconfont"></div>
  </div>



              
                <div class="post-prevnext my-3">
                  <article class="post-prev col-6">
                    
                    
                      <a href="/blog/2022/11/03/Lambda%E8%A1%A8%E8%BE%BE%E5%BC%8F/" title="Lambda表达式">
                        <i class="iconfont icon-arrowleft"></i>
                        <span class="hidden-mobile">Lambda表达式</span>
                        <span class="visible-mobile">上一篇</span>
                      </a>
                    
                  </article>
                  <article class="post-next col-6">
                    
                    
                      <a href="/blog/2022/10/18/%E7%AC%AC%E4%B8%80%E7%AB%A0%20Elasticsearch%E6%A6%82%E8%BF%B0/" title="第一章 Elasticsearch概述">
                        <span class="hidden-mobile">第一章 Elasticsearch概述</span>
                        <span class="visible-mobile">下一篇</span>
                        <i class="iconfont icon-arrowright"></i>
                      </a>
                    
                  </article>
                </div>
              
            </div>

            
  <article id="comments">
    
  <div id="valine"></div>
  <script type="text/javascript">
    Fluid.utils.loadComments('#valine', function() {
      Fluid.utils.createScript('https://lib.baomitu.com/valine/1.4.17/Valine.min.js', function() {
        var options = Object.assign(
          {"appId":"zc2OPBTVjL4nIWcxAdu9fkZp-gzGzoHsz","appKey":"vpIXqlueEoj5yt2RfIa84WzG","path":"window.location.pathname","placeholder":null,"avatar":"retro","meta":["nick","mail","link"],"requiredFields":[],"pageSize":10,"lang":"zh-CN","highlight":false,"recordIP":false,"serverURLs":"","emojiCDN":null,"emojiMaps":null,"enableQQ":false},
          {
            el: "#valine",
            path: window.location.pathname
          }
        )
        new Valine(options);
        Fluid.utils.waitElementVisible('#valine .vcontent', () => {
          var imgSelector = '#valine .vcontent img:not(.vemoji)';
          Fluid.plugins.imageCaption(imgSelector);
          Fluid.plugins.fancyBox(imgSelector);
        })
      });
    });
  </script>
  <noscript>Please enable JavaScript to view the comments</noscript>


  </article>


          </article>
        </div>
      </div>
    </div>

    <div class="side-col d-none d-lg-block col-lg-2">
      
  <aside class="sidebar" style="margin-left: -1rem">
    <div id="toc">
  <p class="toc-header"><i class="iconfont icon-list"></i>&nbsp;目录</p>
  <div class="toc-body" id="toc-body"></div>
</div>



  </aside>


    </div>
  </div>
</div>





  



  



  



  



  







    

    
      <a id="scroll-top-button" aria-label="TOP" href="#" role="button">
        <i class="iconfont icon-arrowup" aria-hidden="true"></i>
      </a>
    

    
      <div class="modal fade" id="modalSearch" tabindex="-1" role="dialog" aria-labelledby="ModalLabel"
     aria-hidden="true">
  <div class="modal-dialog modal-dialog-scrollable modal-lg" role="document">
    <div class="modal-content">
      <div class="modal-header text-center">
        <h4 class="modal-title w-100 font-weight-bold">搜索</h4>
        <button type="button" id="local-search-close" class="close" data-dismiss="modal" aria-label="Close">
          <span aria-hidden="true">&times;</span>
        </button>
      </div>
      <div class="modal-body mx-3">
        <div class="md-form mb-5">
          <input type="text" id="local-search-input" class="form-control validate">
          <label data-error="x" data-success="v" for="local-search-input">关键词</label>
        </div>
        <div class="list-group" id="local-search-result"></div>
      </div>
    </div>
  </div>
</div>

    

    
  </main>

  <footer>
    <footer class="text-center mt-5 py-3">
  
  <!-- 添加网站运行时间 -->
  <div class="footer-content">
    <div>
      
      <script>
      var now = new Date();
      function createtime(){
          var grt= new Date("07/26/2022 09:00:00");//此处修改你的建站时间或者网站上线时间
          now.setTime(now.getTime()+250);
          days = (now - grt ) / 1000 / 60 / 60 / 24;
          dnum = Math.floor(days);
          hours = (now - grt ) / 1000 / 60 / 60 - (24 * dnum);
          hnum = Math.floor(hours);
          if(String(hnum).length ==1 ){
              hnum = "0" + hnum;
          }
          minutes = (now - grt ) / 1000 /60 - (24 * 60 * dnum) - (60 * hnum);
          mnum = Math.floor(minutes);
          if(String(mnum).length ==1 ){
                    mnum = "0" + mnum;
          }
          seconds = (now - grt ) / 1000 - (24 * 60 * 60 * dnum) - (60 * 60 * hnum) - (60 * mnum);
          snum = Math.round(seconds);
          if(String(snum).length ==1 ){
                    snum = "0" + snum;
          }
          document.getElementById("timeDate").innerHTML = "🚀 &nbsp"+dnum+"&nbsp天";  //此次自定义显示内容
          document.getElementById("times").innerHTML = hnum + "&nbsp小时&nbsp" + mnum + "&nbsp分&nbsp" + snum + "&nbsp秒";
      }  //此次自定义显示内容
      setInterval("createtime()",250);
      </script>
    </div>
  </div>
</footer>






<div class="footer-inner">
  
    <div class="footer-content">
       <a href="" target="_blank" rel="nofollow noopener"><span>Vincent</span></a> <a><span>の</span></a> <a href="" target="_blank" rel="nofollow noopener"><span>Blog</span></a> <div style="font-size: 0.85rem"> <span id="timeDate">载入天数...</span> <span id="times">载入时分秒...</span> <script src="/js/duration.js"></script> </div> 
    </div>
   
  
    <div class="statistics">
  
  

  
    
      <span id="busuanzi_container_site_pv" style="display: none">
        总访问量 
        <span id="busuanzi_value_site_pv"></span>
         次
      </span>
    
    
      <span id="busuanzi_container_site_uv" style="display: none">
        总访客数 
        <span id="busuanzi_value_site_uv"></span>
         人
      </span>
    
    
  
</div>

  
  
  
</div>




  </footer>

  <!-- Scripts -->
  
  <script  src="https://lib.baomitu.com/nprogress/0.2.0/nprogress.min.js" ></script>
  <link  rel="stylesheet" href="https://lib.baomitu.com/nprogress/0.2.0/nprogress.min.css" />

  <script>
    NProgress.configure({"showSpinner":true,"trickleSpeed":100})
    NProgress.start()
    window.addEventListener('load', function() {
      NProgress.done();
    })
  </script>


<script  src="https://lib.baomitu.com/jquery/3.6.0/jquery.min.js" ></script>
<script  src="https://lib.baomitu.com/twitter-bootstrap/4.6.1/js/bootstrap.min.js" ></script>
<script  src="/blog/js/events.js" ></script>
<script  src="/blog/js/plugins.js" ></script>


  <script  src="https://lib.baomitu.com/typed.js/2.0.12/typed.min.js" ></script>
  <script>
    (function (window, document) {
      var typing = Fluid.plugins.typing;
      var subtitle = document.getElementById('subtitle');
      if (!subtitle || !typing) {
        return;
      }
      var text = subtitle.getAttribute('data-typed-text');
      
        typing(text);
      
    })(window, document);
  </script>




  
    
      <script  src="/blog/js/img-lazyload.js" ></script>
    
  




  
<script>
  Fluid.utils.createScript('https://lib.baomitu.com/tocbot/4.18.2/tocbot.min.js', function() {
    var toc = jQuery('#toc');
    if (toc.length === 0 || !window.tocbot) { return; }
    var boardCtn = jQuery('#board-ctn');
    var boardTop = boardCtn.offset().top;

    window.tocbot.init({
      tocSelector     : '#toc-body',
      contentSelector : '.markdown-body',
      headingSelector : CONFIG.toc.headingSelector || 'h1,h2,h3,h4,h5,h6',
      linkClass       : 'tocbot-link',
      activeLinkClass : 'tocbot-active-link',
      listClass       : 'tocbot-list',
      isCollapsedClass: 'tocbot-is-collapsed',
      collapsibleClass: 'tocbot-is-collapsible',
      collapseDepth   : CONFIG.toc.collapseDepth || 0,
      scrollSmooth    : true,
      headingsOffset  : -boardTop
    });
    if (toc.find('.toc-list-item').length > 0) {
      toc.css('visibility', 'visible');
    }
  });
</script>


  <script src=https://lib.baomitu.com/clipboard.js/2.0.10/clipboard.min.js></script>

  <script>Fluid.plugins.codeWidget();</script>


  
<script>
  Fluid.utils.createScript('https://lib.baomitu.com/anchor-js/4.3.1/anchor.min.js', function() {
    window.anchors.options = {
      placement: CONFIG.anchorjs.placement,
      visible  : CONFIG.anchorjs.visible
    };
    if (CONFIG.anchorjs.icon) {
      window.anchors.options.icon = CONFIG.anchorjs.icon;
    }
    var el = (CONFIG.anchorjs.element || 'h1,h2,h3,h4,h5,h6').split(',');
    var res = [];
    for (var item of el) {
      res.push('.markdown-body > ' + item.trim());
    }
    if (CONFIG.anchorjs.placement === 'left') {
      window.anchors.options.class = 'anchorjs-link-left';
    }
    window.anchors.add(res.join(', '));
  });
</script>


  
<script>
  Fluid.utils.createScript('https://lib.baomitu.com/fancybox/3.5.7/jquery.fancybox.min.js', function() {
    Fluid.plugins.fancyBox();
  });
</script>


  <script>Fluid.plugins.imageCaption();</script>

  <script defer src="/blog/js/leancloud.js" ></script>

  <script  src="/blog/js/local-search.js" ></script>

  <script defer src="https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js" ></script>





<!-- 主题的启动项，将它保持在最底部 -->
<!-- the boot of the theme, keep it at the bottom -->
<script  src="/blog/js/boot.js" ></script>


  

  <noscript>
    <div class="noscript-warning">博客在允许 JavaScript 运行的环境下浏览效果更佳</div>
  </noscript>
</body>
</html>
